<template>
  <el-form :model="sizeForm" label-width="100px" size="mini">
    <el-form-item label="有无既往病史">
      <el-radio-group v-model="sizeForm.haveMedicalHistory" @change="stateHandle">
        <el-radio
          v-for="item in states"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item v-show="stateValue === 1" label="既往疾病:">
      <el-checkbox-group v-model="sizeForm.medicalHistoryDetailsString" @change="handleChecked">
        <el-checkbox
          v-for="item in sicknesses"
          :key="item.index"
          :label="item.index"
          name="medicalHistoryDetailsString"
        >
          {{ item.title }}
        </el-checkbox>
      </el-checkbox-group>
    </el-form-item>
    <el-divider />
    <ganranxing v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('9') !== -1" ref="grxform" />
    <gaoxueya v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('2') !== -1" ref="gxyform" />
    <guanxinbing v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('4') !== -1" ref="gxbform" />
    <mianyixitongjibing v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('5') !== -1" ref="myxtform" />
    <shengongneng v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('10') !== -1" ref="sgnform" />
    <tangniaobing v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('3') !== -1" ref="tnbform" />
    <xinlvshichang v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('8') !== -1" ref="xlform" />
    <yankejibing v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('6') !== -1" ref="ykform" />
    <zhongliu v-show="stateValue === 1 && medicalHistoryDetailsValue.indexOf('1') !== -1" ref="zlform" />
    <el-form-item label="MG家族史:">
      <el-radio-group v-model="sizeForm.haveMedicalFamilyHistory" @change="stateHandle2">
        <el-radio
          v-for="item in states0"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <relation v-show="haveMedicalFamilyHistoryValue === 1" ref="relation" />
    <el-form-item label="免疫系统疾病家族史:">
      <el-radio-group v-model="sizeForm.haveImmuneMedicalFamilyHistory" @change="stateHandle3">
        <el-radio
          v-for="item in states0"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item v-show="haveImmuneMedicalFamilyHistoryValue === 1" label="免疫系统疾病_诊断名称:">
      <el-checkbox-group v-model="sizeForm.familyHistoryDtoListString" @change="handleChecked1">
        <el-checkbox
          v-for="item in relations"
          :key="item.index"
          :label="item.index"
          name="familyHistoryDtoListString"
        >
          {{ item.title }}
        </el-checkbox>
      </el-checkbox-group>
    </el-form-item>
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('1') !== -1" ref="relation1" title="类风湿关节炎" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('2') !== -1" ref="relation2" title="干燥综合征" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('3') !== -1" ref="relation3" title="系统性红斑狼疮" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('4') !== -1" ref="relation4" title="桥本氏甲状腺炎" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('5') !== -1" ref="relation5" title="多发性硬化" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('6') !== -1" ref="relation6" title="银屑病" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('7') !== -1" ref="relation7" title="炎症性肠病" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('8') !== -1" ref="relation8" title="甲亢" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('9') !== -1" ref="relation9" title="甲减" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('10') !== -1" ref="relation10" title="多发性肌炎" />
    <relation v-show="haveImmuneMedicalFamilyHistoryValue === 1 && nameValue.indexOf('11') !== -1" ref="relation11" title="免疫性心肌炎" />
    <el-form-item label="吸烟史:">
      <el-radio-group v-model="sizeForm.smoke" @change="stateHandle4">
        <el-radio
          v-for="item in states"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item v-show="smokeValue === 1" label="是否戒烟:">
      <el-radio-group v-model="sizeForm.quitSmoking">
        <el-radio
          v-for="item in bools"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="饮酒史:">
      <el-radio-group v-model="sizeForm.drink" @change="stateHandle5">
        <el-radio
          v-for="item in states"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item v-show="drinkValue === 1" label="是否戒酒:">
      <el-radio-group v-model="sizeForm.quitDrinking">
        <el-radio
          v-for="item in bools"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="患者入组情况:">
      <el-radio-group v-model="sizeForm.isRuzu">
        <el-radio
          v-for="item in ruzus"
          :key="item.index"
          :label="item.index"
        >
          {{ item.name }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="备注:">
      <el-input v-model="sizeForm.remarks" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">保存</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import Zhongliu from '../sickness/zhongliu.vue'
import Ganranxing from '../sickness/ganranxing.vue'
import Gaoxueya from '../sickness/gaoxueya.vue'
import Guanxinbing from '../sickness/guanxinbing.vue'
import Mianyixitongjibing from '../sickness/mianyixitongjibing.vue'
import Shengongneng from '../sickness/shengongneng.vue'
import Tangniaobing from '../sickness/tangniaobing.vue'
import Xinlvshichang from '../sickness/xinlvshichang.vue'
import Yankejibing from '../sickness/yankejibing.vue'
import Relation from './relation.vue'
import { addMedicalHistoryBefore } from '@/api/testDashboard'
import { initData } from '@/api/data'

export default {
  components: {
    Zhongliu,
    Ganranxing,
    Gaoxueya,
    Guanxinbing,
    Mianyixitongjibing,
    Shengongneng,
    Tangniaobing,
    Xinlvshichang,
    Yankejibing,
    Relation
  },
  data() {
    return {
      sizeForm: {
        haveMedicalHistory: 0,
        medicalHistoryDetailsString: [],
        familyHistoryDtoListString: [],
        isRuzu: 0,
        haveMedicalFamilyHistory: 0,
        haveImmuneMedicalFamilyHistory: 0,
        quitDrinking: 0,
        quitSmoking: 0,
        smoke: 0,
        drink: 0,
        remarks: ''
      },
      stateValue: 0,
      medicalHistoryDetailsValue: [],
      smokeValue: 0,
      drinkValue: 0,
      haveMedicalFamilyHistoryValue: 0,
      haveImmuneMedicalFamilyHistoryValue: 0,
      nameValue: [],
      params: {
        id: '',
        pid: this._routerRoot._route.query.id,
        haveMedicalHistory: '',
        medicalHistoryDetailsString: [],
        medicalHistoryDetails: [],
        haveMedicalFamilyHistory: '',
        relationship: '',
        pedigree: '',
        haveImmuneMedicalFamilyHistory: '',
        familyHistoryDtoListString: [],
        familyHistoryDtoList: [],
        smoke: '',
        quitSmoking: '',
        drink: '',
        quitDrinking: '',
        isRuzu: '',
        remarks: ''
      },
      query: {
        pid: this._routerRoot._route.query.id
      },
      relation0: {
        relationship: ''
      },
      sicknesses: [
        {
          index: '1',
          title: '肿瘤'
        },
        {
          index: '2',
          title: '高血压'
        },
        {
          index: '3',
          title: '糖尿病'
        },
        {
          index: '4',
          title: '冠心病'
        },
        {
          index: '5',
          title: '免疫系统疾病'
        },
        {
          index: '6',
          title: '眼科疾病'
        },
        {
          index: '7',
          title: '其他疾病'
        },
        {
          index: '8',
          title: '心律失常'
        },
        {
          index: '9',
          title: '感染性疾病'
        },
        {
          index: '10',
          title: '肾功能异常'
        },
        {
          index: '11',
          title: '其他原因所致肝功异常'
        }
      ],
      relations: [
        {
          index: '1',
          name: 'relation1',
          title: '类风湿关节炎'
        },
        {
          index: '2',
          name: 'relation2',
          title: '干燥综合征'
        },
        {
          index: '3',
          name: 'relation3',
          title: '系统性红斑狼疮'
        },
        {
          index: '4',
          name: 'relation4',
          title: '桥本氏甲状腺炎'
        },
        {
          index: '5',
          name: 'relation5',
          title: '多发性硬化'
        },
        {
          index: '6',
          name: 'relation6',
          title: '银屑病'
        },
        {
          index: '7',
          name: 'relation7',
          title: '炎症性肠病'
        },
        {
          index: '8',
          name: 'relation8',
          title: '甲亢'
        },
        {
          index: '9',
          name: 'relation9',
          title: '甲减'
        },
        {
          index: '10',
          name: 'relation10',
          title: '多发性肌炎'
        },
        {
          index: '11',
          name: 'relation11',
          title: '免疫性心肌炎'
        }
      ],
      states: [
        {
          index: 1,
          name: '有'
        },
        {
          index: 2,
          name: '无'
        },
        {
          index: 3,
          name: '不详'
        }
      ],
      bools: [
        {
          index: 1,
          name: '是'
        },
        {
          index: 2,
          name: '否'
        }
      ],
      ruzus: [
        {
          index: 1,
          name: '入组'
        },
        {
          index: 2,
          name: '出组'
        }
      ]
    }
  },
  computed: {
    states0() {
      return this.states.filter(v => v.index < 3)
    }
  },
  created() {
    initData('/api/medicalHistoryBefore/findByPid', this.query).then(res => {
      this.params.id = res.id
      this.sizeForm.haveMedicalHistory = res.haveMedicalHistory
      this.sizeForm.medicalHistoryDetailsString = res.medicalHistoryDetailsString
      this.sizeForm.haveMedicalFamilyHistory = res.haveMedicalFamilyHistory
      this.sizeForm.haveImmuneMedicalFamilyHistory = res.haveImmuneMedicalFamilyHistory
      res.medicalHistoryDetails.forEach(element => {
        if (element.diseaseName === '1') {
          element.medicine = parseInt(element.medicine)
          this.$refs.zlform.zlForm = element
        }
        if (element.diseaseName === '2') {
          this.$refs.gxyform.sizeForm = element
        }
        if (element.diseaseName === '3') {
          this.$refs.tnbform.sizeForm = element
        }
        if (element.diseaseName === '4') {
          this.$refs.gxbform.sizeForm = element
        }
        if (element.diseaseName === '5') {
          this.$refs.myxtform.sizeForm = element
          element.pastDiseaseInfoDtos.forEach(e => {
            if (e.diagnosisName === '1') {
              this.$refs.myxtform.$refs.leifengshiguanjieyan.form = e
            }
            if (e.diagnosisName === '2') {
              this.$refs.myxtform.$refs.ganzaozonghezheng.form = e
            }
            if (e.diagnosisName === '3') {
              this.$refs.myxtform.$refs.hongbanlangchuang.form = e
            }
            if (e.diagnosisName === '4') {
              this.$refs.myxtform.$refs.jiazhuangxianyan.form = e
            }
            if (e.diagnosisName === '5') {
              this.$refs.myxtform.$refs.yinghua.form = e
            }
            if (e.diagnosisName === '6') {
              this.$refs.myxtform.$refs.yinxiebing.form = e
            }
            if (e.diagnosisName === '7') {
              this.$refs.myxtform.$refs.changbing.form = e
            }
            if (e.diagnosisName === '8') {
              this.$refs.myxtform.$refs.jiakang.form = e
            }
            if (e.diagnosisName === '9') {
              this.$refs.myxtform.$refs.jiajian.form = e
            }
            if (e.diagnosisName === '10') {
              this.$refs.myxtform.$refs.jiyan.form = e
            }
            if (e.diagnosisName === '11') {
              this.$refs.myxtform.$refs.xinjiyan.form = e
            }
          })
        }
        if (element.diseaseName === '6') {
          this.$refs.ykform.sizeForm = element
          element.pastDiseaseInfoDtos.forEach(e => {
            if (e.diagnosisName === '1') {
              this.$refs.ykform.$refs.baineizhang.form.id = e.id
              this.$refs.ykform.$refs.baineizhang.form = e
            }
            if (e.diagnosisName === '2') {
              this.$refs.ykform.$refs.qingguangyan.form.id = e.id
              this.$refs.ykform.$refs.qingguangyan.form = e
            }
            if (e.diagnosisName === '3') {
              this.$refs.ykform.$refs.jiemoyan.form.id = e.id
              this.$refs.ykform.$refs.jiemoyan.form = e
            }
            if (e.diagnosisName === '4') {
              this.$refs.ykform.$refs.hongmoyan.form.id = e.id
              this.$refs.ykform.$refs.hongmoyan.form = e
            }
          })
        }
        if (element.diseaseName === '8') {
          this.$refs.xlform.sizeForm = element
        }
        if (element.diseaseName === '9') {
          this.$refs.grxform.sizeForm = element
        }
        if (element.diseaseName === '10') {
          this.$refs.sgnform.sizeForm = element
        }
      })
      if (res.pedigree) {
        var array = res.pedigree.split(',')
        var list = []
        array.forEach(function(item) {
          var obj = {
            url: item
          }
          list.push(obj)
        })
        this.$refs.relation.$refs.upload.fileList = list
        this.$refs.relation.$refs.upload.images = res.pedigree
      }
      this.$refs.relation.form.relationship = res.relationship + ''
      console.log(this.$refs.relation.$refs.upload.dialogImageUrl)
      this.sizeForm.familyHistoryDtoListString = res.familyHistoryDtoListString
      res.familyHistoryDtoList.forEach(e => {
        if (e.name === 1) {
          e.relationship = e.relationship + ''
          this.$refs.relation1.form = e
          if (e.pedigree) {
            var array1 = res.pedigree.split(',')
            var list1 = []
            array1.forEach(function(item) {
              var obj = {
                url: item
              }
              list1.push(obj)
            })
            this.$refs.relation1.$refs.upload.fileList = list1
            this.$refs.relation1.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 2) {
          e.relationship = e.relationship + ''
          this.$refs.relation2.form = e
          if (e.pedigree) {
            var array2 = res.pedigree.split(',')
            var list2 = []
            array2.forEach(function(item) {
              var obj = {
                url: item
              }
              list2.push(obj)
            })
            this.$refs.relation2.$refs.upload.fileList = list2
            this.$refs.relation2.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 3) {
          e.relationship = e.relationship + ''
          this.$refs.relation3.form = e
          if (e.pedigree) {
            var array3 = res.pedigree.split(',')
            var list3 = []
            array3.forEach(function(item) {
              var obj = {
                url: item
              }
              list3.push(obj)
            })
            this.$refs.relation3.$refs.upload.fileList = list3
            this.$refs.relation3.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 4) {
          e.relationship = e.relationship + ''
          this.$refs.relation4.form = e
          if (e.pedigree) {
            var array4 = res.pedigree.split(',')
            var list4 = []
            array4.forEach(function(item) {
              var obj = {
                url: item
              }
              list4.push(obj)
            })
            this.$refs.relation4.$refs.upload.fileList = list4
            this.$refs.relation4.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 5) {
          e.relationship = e.relationship + ''
          this.$refs.relation5.form = e
          if (e.pedigree) {
            var array5 = res.pedigree.split(',')
            var list5 = []
            array5.forEach(function(item) {
              var obj = {
                url: item
              }
              list5.push(obj)
            })
            this.$refs.relation5.$refs.upload.fileList = list5
            this.$refs.relation5.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 6) {
          e.relationship = e.relationship + ''
          this.$refs.relation6.form = e
          if (e.pedigree) {
            var array6 = res.pedigree.split(',')
            var list6 = []
            array6.forEach(function(item) {
              var obj = {
                url: item
              }
              list6.push(obj)
            })
            this.$refs.relation6.$refs.upload.fileList = list6
            this.$refs.relation6.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 7) {
          e.relationship = e.relationship + ''
          this.$refs.relation7.form = e
          if (e.pedigree) {
            var array7 = res.pedigree.split(',')
            var list7 = []
            array7.forEach(function(item) {
              var obj = {
                url: item
              }
              list7.push(obj)
            })
            this.$refs.relation7.$refs.upload.fileList = list7
            this.$refs.relation7.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 8) {
          e.relationship = e.relationship + ''
          this.$refs.relation8.form = e
          if (e.pedigree) {
            var array8 = res.pedigree.split(',')
            var list8 = []
            array8.forEach(function(item) {
              var obj = {
                url: item
              }
              list8.push(obj)
            })
            this.$refs.relation8.$refs.upload.fileList = list8
            this.$refs.relation8.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 9) {
          e.relationship = e.relationship + ''
          this.$refs.relation9.form = e
          if (e.pedigree) {
            var array9 = res.pedigree.split(',')
            var list9 = []
            array9.forEach(function(item) {
              var obj = {
                url: item
              }
              list9.push(obj)
            })
            this.$refs.relation9.$refs.upload.fileList = list9
            this.$refs.relation9.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 10) {
          e.relationship = e.relationship + ''
          this.$refs.relation10.form = e
          if (e.pedigree) {
            var array10 = res.pedigree.split(',')
            var list10 = []
            array10.forEach(function(item) {
              var obj = {
                url: item
              }
              list10.push(obj)
            })
            this.$refs.relation10.$refs.upload.fileList = list10
            this.$refs.relation10.$refs.upload.images = res.pedigree
          }
        }
        if (e.name === 11) {
          e.relationship = e.relationship + ''
          this.$refs.relation11.form = e
          if (e.pedigree) {
            var array11 = res.pedigree.split(',')
            var list11 = []
            array11.forEach(function(item) {
              var obj = {
                url: item
              }
              list11.push(obj)
            })
            this.$refs.relation11.$refs.upload.fileList = list11
            this.$refs.relation11.$refs.upload.images = res.pedigree
          }
        }
      })
      this.sizeForm.quitSmoking = res.quitSmoking
      this.sizeForm.smoke = res.smoke
      this.sizeForm.quitDrinking = res.quitDrinking
      this.sizeForm.drink = res.drink
      this.sizeForm.isRuzu = res.isRuzu
      this.sizeForm.remarks = res.remarks
      this.medicalHistoryDetailsValue = this.sizeForm.medicalHistoryDetailsString
      this.nameValue = this.sizeForm.familyHistoryDtoListString
      this.stateValue = this.sizeForm.haveMedicalHistory
      this.smokeValue = this.sizeForm.smoke
      this.drinkValue = this.sizeForm.drink
      this.haveMedicalFamilyHistoryValue = this.sizeForm.haveMedicalFamilyHistory
      this.haveImmuneMedicalFamilyHistoryValue = this.sizeForm.haveImmuneMedicalFamilyHistory
    })
  },
  methods: {
    onSubmit() {
      console.log(this.$refs)
      this.params.haveMedicalHistory = this.sizeForm.haveMedicalHistory
      this.params.medicalHistoryDetailsString = this.sizeForm.medicalHistoryDetailsString
      this.params.haveMedicalFamilyHistory = this.sizeForm.haveMedicalFamilyHistory
      this.params.haveImmuneMedicalFamilyHistory = this.sizeForm.haveImmuneMedicalFamilyHistory
      this.params.medicalHistoryDetails = []
      this.params.medicalHistoryDetails.push(this.$refs.zlform.zlForm)
      this.params.medicalHistoryDetails.push(this.$refs.grxform.sizeForm)
      this.params.medicalHistoryDetails.push(this.$refs.gxyform.sizeForm)
      this.params.medicalHistoryDetails.push(this.$refs.gxbform.sizeForm)
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos = []
      this.$refs.myxtform.$refs.leifengshiguanjieyan.form.diagnosisName = '1'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.leifengshiguanjieyan.form)
      this.$refs.myxtform.$refs.ganzaozonghezheng.form.diagnosisName = '2'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.ganzaozonghezheng.form)
      this.$refs.myxtform.$refs.hongbanlangchuang.form.diagnosisName = '3'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.hongbanlangchuang.form)
      this.$refs.myxtform.$refs.jiazhuangxianyan.form.diagnosisName = '4'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.jiazhuangxianyan.form)
      this.$refs.myxtform.$refs.yinghua.form.diagnosisName = '5'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.yinghua.form)
      this.$refs.myxtform.$refs.yinxiebing.form.diagnosisName = '6'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.yinxiebing.form)
      this.$refs.myxtform.$refs.changbing.form.diagnosisName = '7'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.changbing.form)
      this.$refs.myxtform.$refs.jiakang.form.diagnosisName = '8'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.jiakang.form)
      this.$refs.myxtform.$refs.jiajian.form.diagnosisName = '9'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.jiajian.form)
      this.$refs.myxtform.$refs.jiyan.form.diagnosisName = '10'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.jiyan.form)
      this.$refs.myxtform.$refs.xinjiyan.form.diagnosisName = '11'
      this.$refs.myxtform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.myxtform.$refs.xinjiyan.form)
      this.params.medicalHistoryDetails.push(this.$refs.myxtform.sizeForm)
      this.params.medicalHistoryDetails.push(this.$refs.sgnform.sizeForm)
      this.params.medicalHistoryDetails.push(this.$refs.tnbform.sizeForm)
      this.params.medicalHistoryDetails.push(this.$refs.xlform.sizeForm)
      this.$refs.ykform.sizeForm.pastDiseaseInfoDtos = []
      this.$refs.ykform.$refs.baineizhang.form.diagnosisName = '1'
      this.$refs.ykform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.ykform.$refs.baineizhang.form)
      this.$refs.ykform.$refs.qingguangyan.form.diagnosisName = '2'
      this.$refs.ykform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.ykform.$refs.qingguangyan.form)
      this.$refs.ykform.$refs.jiemoyan.form.diagnosisName = '3'
      this.$refs.ykform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.ykform.$refs.jiemoyan.form)
      this.$refs.ykform.$refs.hongmoyan.form.diagnosisName = '4'
      this.$refs.ykform.sizeForm.pastDiseaseInfoDtos.push(this.$refs.ykform.$refs.hongmoyan.form)
      this.params.medicalHistoryDetails.push(this.$refs.ykform.sizeForm)
      this.params.relationship = this.$refs.relation.form.relationship
      this.params.pedigree = this.$refs.relation.$refs.upload.images
      this.params.familyHistoryDtoListString = this.sizeForm.familyHistoryDtoListString
      this.params.familyHistoryDtoList = []
      this.$refs.relation1.form.name = '1'
      this.$refs.relation2.form.name = '2'
      this.$refs.relation3.form.name = '3'
      this.$refs.relation4.form.name = '4'
      this.$refs.relation5.form.name = '5'
      this.$refs.relation6.form.name = '6'
      this.$refs.relation7.form.name = '7'
      this.$refs.relation8.form.name = '8'
      this.$refs.relation9.form.name = '9'
      this.$refs.relation10.form.name = '10'
      this.$refs.relation11.form.name = '11'
      this.$refs.relation1.form.pedigree = this.$refs.relation1.$refs.upload.images
      this.$refs.relation2.form.pedigree = this.$refs.relation2.$refs.upload.images
      this.$refs.relation3.form.pedigree = this.$refs.relation3.$refs.upload.images
      this.$refs.relation4.form.pedigree = this.$refs.relation4.$refs.upload.images
      this.$refs.relation5.form.pedigree = this.$refs.relation5.$refs.upload.images
      this.$refs.relation6.form.pedigree = this.$refs.relation6.$refs.upload.images
      this.$refs.relation7.form.pedigree = this.$refs.relation7.$refs.upload.images
      this.$refs.relation8.form.pedigree = this.$refs.relation8.$refs.upload.images
      this.$refs.relation9.form.pedigree = this.$refs.relation9.$refs.upload.images
      this.$refs.relation10.form.pedigree = this.$refs.relation10.$refs.upload.images
      this.$refs.relation11.form.pedigree = this.$refs.relation11.$refs.upload.images
      this.params.familyHistoryDtoList.push(this.$refs.relation1.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation2.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation3.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation4.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation5.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation6.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation7.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation8.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation9.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation10.form)
      this.params.familyHistoryDtoList.push(this.$refs.relation11.form)
      this.params.quitSmoking = this.sizeForm.quitSmoking
      this.params.smoke = this.sizeForm.smoke
      this.params.quitDrinking = this.sizeForm.quitDrinking
      this.params.drink = this.sizeForm.drink
      this.params.isRuzu = this.sizeForm.isRuzu
      this.params.remarks = this.sizeForm.remarks
      addMedicalHistoryBefore(this.params).then(res => {
        alert('保存成功！')
      })
    },
    handleChecked(v) {
      this.medicalHistoryDetailsValue = v
    },
    handleChecked1(v) {
      this.nameValue = v
    },
    stateHandle(v) {
      this.stateValue = v
    },
    stateHandle2(v) {
      this.haveMedicalFamilyHistoryValue = v
    },
    stateHandle3(v) {
      this.haveImmuneMedicalFamilyHistoryValue = v
    },
    stateHandle4(v) {
      this.smokeValue = v
    },
    stateHandle5(v) {
      this.drinkValue = v
    }
  }
}
</script>

<style>

</style>
